<?php
namespace app\home\model;

use think\Model;

class ProfessionModel extends Model
{
    protected $table = 'sf_profession';
    protected $autoWriteTimestamp = true;
    protected $createTime = 'add_time';
    protected $updateTime = 'update_time';
    public function __construct($data = [],$event = [])
    {
        foreach ($event as $key=>$value){
            ProfessionModel::event($key,$value);
        }
        parent::__construct($data);
    }
    public function imgs()
    {
        return $this->hasMany('ProfessionImgModel','message_id','id');
    }
    public function getAddTimeAttr($data){
        return date('Y-m-d H:i:s',$data);
    }
    public function getUpdateTimeAttr($data){
        return date('Y-m-d H:i:s',$data);
    }
}
